-
Notifications
You must be signed in to change notification settings - Fork 103
tapd: add itest for grouped asset channel funding #987
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
bf764ca
to
3c5f6cb
Compare
3c5f6cb
to
4c38293
Compare
84bf0f8
to
d30865e
Compare
d30865e
to
103e485
Compare
Updated |
@GeorgeTsagk: review reminder |
103e485
to
e159f66
Compare
684cb4e
to
b14f20b
Compare
Ready for review, @ffranr and @GeorgeTsagk. |
b14f20b
to
85ae741
Compare
We remove the Zane node from all tests where its only role was being the universe server. Starting a node takes multiple seconds, so if we can spin up fewer nodes, we can save some time. And functionality wise Charlie can easily be the universe, we just need to define its port upfront so we can configure it to be its own proof courier.
85ae741
to
dedf12c
Compare
2ce063a
to
23f300d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Non-blocking: Since the group keys on taprpc are already merged, we could enhance testCustomChannelsLiquidityEdgeCasesCore
with an extra option similar to groupMode
, which would control whether we open single asset ID or group funded channels. This way we could incorporate low-hanging coverage for this PR. Not sure what the diff for that would be, could def be a follow-up PR.
This commit prepares some of the helper functions to be able to handle channels that have multiple asset pieces in them.
We'll be adding a new HTLC force close test where we'll be able to re-use this functionality.
23f300d
to
21e38f3
Compare
Addressed comments. |
// We use Charlie as the proof courier. But in order for Charlie to also | ||
// use itself, we need to define its port upfront. | ||
charliePort := port.NextAvailablePort() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe here and in the git commit message (or next to the topology map) we can mention that charlie is effectively a remote universe server for Erin/Fabia. And maybe the same for the other tests.
// Then we burn everything but a single asset piece. | ||
assetID1 := mintedAssets[0].AssetGenesis.AssetId | ||
assetID2 := mintedAssets[1].AssetGenesis.AssetId | ||
burnAmount1 := mintedAssets[0].Amount - charlieFundingAmount/2 - | ||
erinFundingAmount/2 - 1 | ||
_, err := charlieTap.BurnAsset(ctx, &taprpc.BurnAssetRequest{ | ||
Asset: &taprpc.BurnAssetRequest_AssetId{ | ||
AssetId: assetID1, | ||
}, | ||
AmountToBurn: burnAmount1, | ||
ConfirmationText: taprootassets.AssetBurnConfirmationText, | ||
}) | ||
require.NoError(t.t, err) | ||
|
||
mineBlocks(t, net, 1, 1) | ||
|
||
burnAmount2 := mintedAssets[1].Amount - charlieFundingAmount/2 - | ||
erinFundingAmount/2 - 1 | ||
_, err = charlieTap.BurnAsset(ctx, &taprpc.BurnAssetRequest{ | ||
Asset: &taprpc.BurnAssetRequest_AssetId{ | ||
AssetId: assetID2, | ||
}, | ||
AmountToBurn: burnAmount2, | ||
ConfirmationText: taprootassets.AssetBurnConfirmationText, | ||
}) | ||
require.NoError(t.t, err) | ||
|
||
mineBlocks(t, net, 1, 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we doing this. Please consider adding a bit more to the comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we burn all but a small piece as we don't support fully burning an asset in a single transaction.
Depends on lightninglabs/taproot-assets#1478.